using System;
using System.Collections.Generic;
using System.Text;
using Castle.ActiveRecord;

namespace ElevatorSpeeches.Framework
{
	[ActiveRecord]
	public class Adjective : EntityBase<Adjective>
	{
        [Property]
        public string Body { get; set; }

		public static Adjective GetOrCreate(string AdjectiveBody)
		{
			Adjective adjective = Adjective.FindFirst(new NHibernate.Expression.EqExpression("Body", AdjectiveBody));

			if (adjective != null)
			{
				return adjective;
			}
			else
			{
				adjective = new Adjective();
				adjective.Body = AdjectiveBody;
				adjective.Save();
				return adjective;
			}
		}
	}
}
